package com.cjj.common.enums;

/**
 * 帖子状态枚举
 */
public enum PostStatus {
    PENDING("pending", "待审核"),
    PUBLISHED("published", "已发布"),
    REJECTED("rejected", "已拒绝"),
    DELETED("deleted", "已删除");
    
    private final String value;
    private final String desc;
    
    PostStatus(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    
    public String getValue() { return value; }
    public String getDesc() { return desc; }
    
    public static PostStatus fromValue(String value) {
        for (PostStatus status : values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("未知的帖子状态: " + value);
    }
}